473,461 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

URLencode a URL Query string

Hello All,
from my C# dialog based application I am creating a URL that has some
query string parameters that I want to URL encode, the URLEncode function is
suppose to be in the HttpUtility class under System.Web but I cannot seem to
find it, is there an alternate to encode a URL query string in C#?

Imran.
Nov 17 '05 #1
2 38144
Did u add reference to system.web.assembly
System.Web.HttpUtility.UrlEncode
Theres some discussion on this at this link try
http://www.experts-exchange.com/Prog..._21044897.html

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/

Nov 17 '05 #2
HttpUtility is under System.Web, u have to include it in ur project..ie

using System.Web,

u also have to add the dll itself as a refernce into ur project..ie on the
Reference Folder (under the Solution explorer) right-click, add reference,
and its in the list.

once u do both steps, then u have access to HttpUtility.urlEncode()

Hope this helps

"Imran Aziz" wrote:
Hello All,
from my C# dialog based application I am creating a URL that has some
query string parameters that I want to URL encode, the URLEncode function is
suppose to be in the HttpUtility class under System.Web but I cannot seem to
find it, is there an alternate to encode a URL query string in C#?

Imran.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Joshua Beall | last post by:
Hi All, I can see from the manual that the difference between urlencode and rawurlencode is that urlencode translates spaces to '+' characters, whereas rawurlencode translates it into it's hex...
22
by: Fawke101 | last post by:
Hi there, I am having trouble with some data that is ripped from a SQL database and displayed as a hyperlink. The hyperlink inserts the data into a querystring so the next page can read it. ...
1
by: Jim | last post by:
Hello, I'm trying to do urllib.urlencode() with unicode correctly, and I wonder if some kind person could set me straight? My understanding is that I am supposed to be able to urlencode...
3
by: Russ | last post by:
Response.Redirect(@".\folder\" + filename); How could I urlencode this statement so that if the filename contains a special character (in my case a #) the redirect will still function?
5
by: vtreddy | last post by:
Hi All: In my application I am sending the input values through query string from a datagrid template column,I used URLEncode to encode the URL String, please find the input below, I am facing a...
0
by: Darrel | last post by:
I'm trying to pass a query string that contains an apostrophe. I set it to server.urlencode, but I noticed it doesn't do anything with the apostrophes. I can easy check for this myself, but I was...
0
by: Nathan Sokalski | last post by:
I am using Server.UrlEncode to make a piece of data safe to use as a QueryString. The data I am using is as follows: ratedpoem("title") Which returns the following String: "An Expression...
12
by: sleytr | last post by:
Hi, I'm trying to make a gui for a web service. Site using ± character in value of some fields. But I can't encode this character properly. >>> data = {'key':'±'} >>> urllib.urlencode(data)...
6
by: CindyH | last post by:
Hi I'm not sure whether I should send this as a new message or use the one I've been using but... I'm using vb.net 2.0 - My problem is I need to send something like this: 'dim encodedstring =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.